﻿//------------------------------------------------------------
// Game Framework
// Copyright © 2013-2021 Jiang Yin. All rights reserved.
// Homepage: https://gameframework.cn/
// Feedback: mailto:ellan@gameframework.cn
//------------------------------------------------------------
// 此文件由工具自动生成，请勿直接修改。
// 生成时间：2024-12-30 16:18:50.099
//------------------------------------------------------------

using GameFramework;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using UnityEngine;
using UnityGameFramework.Runtime;

namespace ProjectMG
{
    /// <summary>
    /// COMMENT。
    /// </summary>
    public class DRUIForm : DataRowBase
    {
        private int m_Id = 0;

        /// <summary>
        /// 获取界面Id。
        /// </summary>
        public override int Id
        {
            get
            {
                return m_Id;
            }
        }

        /// <summary>
        /// 获取资源名称。
        /// </summary>
        public string AssetName
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取界面组名称。
        /// </summary>
        public string UIGroupName
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取是否允许多个界面实例。
        /// </summary>
        public bool AllowMultiInstance
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取是否暂停被其覆盖的同组界面。
        /// </summary>
        public bool PauseCoveredUIForm
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取是否隐藏Menu层界面。
        /// </summary>
        public bool PauseMenuUIGroup
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取是否隐藏Main层界面。
        /// </summary>
        public bool PauseMainUIGroup
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取是否隐藏Main2层界面。
        /// </summary>
        public bool PauseMain2UIGroup
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取是否隐藏Main3层界面。
        /// </summary>
        public bool PauseMain3UIGroup
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取是否隐藏Message层。
        /// </summary>
        public bool PauseMessageUIGroup
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取是否显示蒙板。
        /// </summary>
        public bool ShowBackgroundMask
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取打开音效。
        /// </summary>
        public int OpenSound
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取关闭音效。
        /// </summary>
        public int CloseSound
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取跳转场景是否关闭。
        /// </summary>
        public bool ChangeClose
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取进入动画持续时间。
        /// </summary>
        public float InDuration
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取弹出动画持续时间。
        /// </summary>
        public float OutDuration
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取偏移值，就是Offset节点会往哪个方向便宜多少。这里填的数值恒为正数，程序计算。
        /// </summary>
        public float Offset
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取背景是否虚化。
        /// </summary>
        public bool BlurBG
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取是否可以用ESC关闭(-1:不允许；0：屏蔽此功能；1:允许）。
        /// </summary>
        public int ESCClose
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取打开时是否统一关闭tips。
        /// </summary>
        public bool NeedCloseTips
        {
            get;
            private set;
        }

        public override bool ParseDataRow(string dataRowString, object userData)
        {
            string[] columnStrings = dataRowString.Split(DataTableExtension.DataSplitSeparators);
            for (int i = 0; i < columnStrings.Length; i++)
            {
                columnStrings[i] = columnStrings[i].Trim(DataTableExtension.DataTrimSeparators);
            }

            int index = 0;
            int? key = null;
            try
            {
                m_Id = int.Parse(columnStrings[index++]);
                key = m_Id;
                index++;
                AssetName = columnStrings[index++];
                UIGroupName = columnStrings[index++];
                AllowMultiInstance = bool.Parse(columnStrings[index++]);
                PauseCoveredUIForm = bool.Parse(columnStrings[index++]);
                PauseMenuUIGroup = bool.Parse(columnStrings[index++]);
                PauseMainUIGroup = bool.Parse(columnStrings[index++]);
                PauseMain2UIGroup = bool.Parse(columnStrings[index++]);
                PauseMain3UIGroup = bool.Parse(columnStrings[index++]);
                PauseMessageUIGroup = bool.Parse(columnStrings[index++]);
                ShowBackgroundMask = bool.Parse(columnStrings[index++]);
                OpenSound = int.Parse(columnStrings[index++]);
                CloseSound = int.Parse(columnStrings[index++]);
                ChangeClose = bool.Parse(columnStrings[index++]);
                InDuration = float.Parse(columnStrings[index++]);
                OutDuration = float.Parse(columnStrings[index++]);
                Offset = float.Parse(columnStrings[index++]);
                BlurBG = bool.Parse(columnStrings[index++]);
                ESCClose = int.Parse(columnStrings[index++]);
                NeedCloseTips = bool.Parse(columnStrings[index++]);
                index++;
            }
            catch (Exception e)
            {
                ((DataTableHelper.ParseDataRowError)userData).Set(index, key, e);
                return false;
            }

            return true;
        }

        public override bool ParseDataRow(byte[] dataRowBytes, int startIndex, int length, object userData)
        {
            Tuple<BinaryReader, GameFrameworkFunc<int, string>> tuple = (Tuple<BinaryReader, GameFrameworkFunc<int, string>>)userData;
            BinaryReader binaryReader = tuple.Item1;
            GameFrameworkFunc<int, string> GetString = tuple.Item2;

            m_Id = binaryReader.Read7BitEncodedInt32();
            AssetName = binaryReader.ParseSystemType<string>();
            UIGroupName = binaryReader.ParseSystemType<string>();
            AllowMultiInstance = binaryReader.ParseSystemType<bool>();
            PauseCoveredUIForm = binaryReader.ParseSystemType<bool>();
            PauseMenuUIGroup = binaryReader.ParseSystemType<bool>();
            PauseMainUIGroup = binaryReader.ParseSystemType<bool>();
            PauseMain2UIGroup = binaryReader.ParseSystemType<bool>();
            PauseMain3UIGroup = binaryReader.ParseSystemType<bool>();
            PauseMessageUIGroup = binaryReader.ParseSystemType<bool>();
            ShowBackgroundMask = binaryReader.ParseSystemType<bool>();
            OpenSound = binaryReader.ParseSystemType<int>();
            CloseSound = binaryReader.ParseSystemType<int>();
            ChangeClose = binaryReader.ParseSystemType<bool>();
            InDuration = binaryReader.ParseSystemType<float>();
            OutDuration = binaryReader.ParseSystemType<float>();
            Offset = binaryReader.ParseSystemType<float>();
            BlurBG = binaryReader.ParseSystemType<bool>();
            ESCClose = binaryReader.ParseSystemType<int>();
            NeedCloseTips = binaryReader.ParseSystemType<bool>();

            return true;
        }

        // No Property Collection
    }
}
